package future优化.回调版的future;

import java.util.concurrent.CopyOnWriteArrayList;

/**
 * @author ZhuQi
 * @ClassName SuccessThreadList
 * @Date 2022/9/5 14:13
 * @Version 1.0
 * @Description 成功的 Future 的线程ID
 */
public class SuccessThreadList {

    private static final CopyOnWriteArrayList<Long> threadIds = new CopyOnWriteArrayList<>();

    public static void setThreadId(Long threadId){
        threadIds.add(threadId);
    }

    /**
     * 拿到容器
     * @return
     */
    public static CopyOnWriteArrayList<Long> getThreadIds() {
        return threadIds;
    }
}
